package com.example.utils;

import lombok.Getter;

@Getter
public enum ResultCodeUtil {
    SUCCESS(200, "SUCCESS", ""),
    PARAMS_ERROR(40000, "请求参数错误", ""),
    NULL_ERROR(40001, "请求数据为空", ""),
    VALIDATION_ERROR(40002, "验证失败", ""),
    DATABASE_ERROR(40003, "数据库请求异常", ""),
    REDIS_ERROR(40004, "数据库请求异常", ""),
    DATA_ERROR(40005, "数据查询失败", ""),
    DATA_EXISTS(40006, "数据存在", ""),
    METHOD_ERROR(405, "请求方式错误", ""),

    NOT_LOGIN(40100, "未登录", ""),
    NOT_PATH(404, "路径不存在", ""),
    CONNECT_OUT(40101, "连接超时", ""),
    NO_AUTH(40201, "无权限", ""),
    FORBIDDEN(40202, "禁止操作", ""),
    SYSTEM_ERROR(50000, "系统内部异常", "");

    // 只能读取，不能修改
    // 错误码
    private final int code;

    // 错误码信息
    private final String message;

    // 错误码描述（详细）
    private final String description;

    ResultCodeUtil(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }
}
